
<template>
  <view class="" style="width: 100%;">
    <web-view :src="url" @message ="getMessage"></web-view>
  </view>
</template>
 
<script>
	import {
		mapState
	} from "vuex"
	import $api from '@/api/index.js';
  export default {
    data() {
      return {
        // url: "https://app.bbi-love.com/Appapi/Detail/index",
		url: "",
      }
    },
	onLoad(e) {
		// this.url = 'https://app.bbi-love.com/Appapi/Detail/index&uid=' + this.userInfo.id
		this.url = e.url + '&uid=' + e.uid
		console.log(this.url)
		this.$util.setNavigationBarColor({
			bg: this.primaryColor
		})
		// 传入需要跳转的链接 使用web-view标签进行跳转
		// this.url = decodeURIComponent(e.url)
		// console.log(this.url)
	},
	computed: mapState({
		primaryColor: state => state.config.configInfo.primaryColor,
		subColor: state => state.config.configInfo.subColor,
		configInfo: state => state.config.configInfo,
		userInfo: state => state.user.userInfo,
	}),
    methods: {
      getMessage(event) {
        let data = event.detail.data
        console.log(data);
      }
    }
  }
</script>
 
<style lang="stylus" scoped>
$webviewHeight = 420rpx
.webview
  width 750rpx
  height $webviewHeight
</style>

